<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .title {
      background-color: aqua;
    }
  </style>
</head>
<body>
  <div id="test"></div>

  <script src="../js/react.development.js"></script>
  <script src="../js/react-dom.development.js"></script>
  <script src="../js/babel.min.js"></script>

  <script type="text/babel">
    const myId = 'atguigu9'
    // 创建虚拟dom  jsx  
    const VDOM = (
    <div>
      <h2 id={myId}>
        <span className='title'>Hello, React</span>
        <span style={{color: 'red'}}>nice</span>
      </h2>
    </div>
    )
    
    // 渲染到页面
    ReactDOM.render (VDOM, document.getElementById ('test'))

    /*
      jsx语法规则：
      1 不写引号
      2 标签中汇入js表达式要用{}
      3 样式类名className
      4 内联样式：style={{color: 'white'}}
      5 只能有一个根标签
      6 标签闭合
      7 标签首字母： 小写转为html同名，大写组件

    
    */
  </script>
</body>
</html>